<!doctype html>
<html>

<head>
  <meta charset="utf-8">
  <title>自动备份软件</title>
  <link href="1.css" type="text/css" rel="stylesheet">
</head>
<script>
  function register() {
    window.location.href = "register.html";
  }
  function login() {
    var show = document.getElementById("show");
    var user = document.getElementById("user");
    var pwd = document.getElementById("pwd");
    if (user.value == "admin" && pwd.value == "admin") {
      show.innerHTML = "登录成功！<br>正在跳转到首页";
      setTimeout(function () {
        window.location.href = "main.html";
      }, 1000);
    } else {
      show.innerHTML = "账号或密码错误！<br>账号 admin 密码 admin";
      user.value = "admin";
      pwd.value = "admin";
    }
  }
  function pwd() {
    var show = document.getElementById("show");
    var user = document.getElementById("user");
    var pwd = document.getElementById("pwd");
    show.innerHTML = "账号 admin 密码 admin";
    user.value = "admin";
    pwd.value = "admin";
  }
</script>

<body>
  <h1>登录</h1>
  <table align="center">
    <tr>
      <td>用户名：</td>
      <td><input type="text" id="user" size="16"></td>
    </tr>
    <tr>
      <td>密&ensp;&ensp;码：</td>
      <td><input type="password" id="pwd" size="16"></td>
    </tr>
    <tr>
      <td><input type="button" value="注册" class="i" onClick="register()"></td>
      <td>
        <input type="button" value="登录" class="i" onClick="login()">
        <a href="#" style="font-size: 10px;" onClick="pwd()">忘记密码</a>
      </td>
    </tr>
  </table>
  <p id="show"></p>
</body>

</html>